package cn.edu.scau.cmi.chenyiqiu.simpleFactoryMethod;

import javafx.collections.FXCollections;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.ComboBox;
import javafx.scene.control.TextArea;
public class Uicontroller {
	
	@FXML
	private Button sure;
	@FXML
	private TextArea InsText;
	@FXML
	private FXCollections observableArrayList;
	@FXML
	private ComboBox id_ComboBox;
	public void sureIns() {
		if(id_ComboBox.getSelectionModel().isEmpty())
			InsText.setText("请选择！");
		else {
		String type;
		type=id_ComboBox.getValue().toString();
		Producer policy=null;
		Meat m=Producer.getPolicyObj(type);
		if(m==null)
		{
			InsText.setText("请选择！");
		}
		else {
		String info=m.getInfo();
		InsText.setText(info);
		}
		}
	}
	

}
